﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using log4net;
using log4net.Config;

[assembly: XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
namespace AutoWelding.Utils
{
    public static class LogHelper
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(LogHelper));

        public static void DeBug(Type type, string info)
        {
            var log = LogManager.GetLogger(type);
            log.Debug(info);
        }

        public static void Info(Type type, string info)
        {
            var log = LogManager.GetLogger(type);
            log.Info(info);
        }

        public static void Error(Type type, string info)
        {
            var log = LogManager.GetLogger(type);
            log.Error(info);
        }

        public static void Error(Type type, string info, Exception ex)
        {
            var log = LogManager.GetLogger(type);
            log.Error(info, ex);
        }

        public static void Warn(Type type, string info)
        {
            var log = LogManager.GetLogger(type);
            log.Warn(info);
        }
    }
}